import { Injectable } from "@angular/core";
import { Config } from "./config";
import {
  Http,
  Headers,
  RequestOptions,
  Response,
  RequestOptionsArgs
} from "@angular/http";
import "rxjs/add/operator/toPromise";
import "rxjs/add/operator/map";
import "rxjs/add/operator/catch";
import "rxjs/add/operator/timeout";
import "rxjs/Rx";
import { Observable } from "rxjs/Observable";
import { Subject } from "rxjs/Subject";
import { Router } from "@angular/router";

let b = 'VJzWZc%F';
@Injectable()
export class HttpServcie {
  headers: any = {};
  constructor(private http: Http, private router: Router) {
    this.headers.timestamp = new Date().getTime();
  }

  /**
   * private headers = new Headers({'Content-Type': 'application/json'});
   * headers.token=UTILCONFIG.token
   *
   * 当为普通数据类型的时候，调用post方法，参数进行加密，如果是上传文件等使用postfile，不进行加密
   *
   */

  post(url: string, params: Object, options: RequestOptions) {
    if (params) {
      params = window['Base64'].encode((JSON.stringify(params)));
      params = this.base64Encode(params);
    }
    return this.http
      .post(url, params, options)
      .timeout(600000)
      .map(this.handleSuccess)
      .catch(this.handleError);
  }

  /**
   * 上传file文件时候调用，参数不进行加密
   * @param url
   * @param params
   * @param options
   */
  postfile(url: string, params: Object, options: RequestOptions) {
    return this.http
      .post(url, params, options)
      .timeout(600000)
      .map(this.handleSuccess)
      .catch(this.handleError);
  }

  postNoBase(url: string, params: Object, options: RequestOptions) {
    return this.http
      .post(url, params, options)
      .timeout(600000)
      .map(this.handleSuccess)
      .catch(this.handleError);
  }

  /**
   * 用的是Aes加密
   * @param parmas
   */
  base64Encode(parmas) {
    let aesUtil = window['AesUtil'];
    // parmas.soc = new Date().getTime();
    if (parmas) {
      let encodeString = aesUtil.Encrypt(parmas, Config.a + b);
      let param = {
        'securityParam': encodeString
      }
      return param;
    }
    return null;
  }

  /**
   * base64加密
   * @param url
   * @param params
   */
  base64encoder(Context): any {

    let encoder = new Buffer(Context).toString('base64');

    return encoder;

  }

  postAutoHeader(url: string, params: Object) {
    this.headers.timestamp = new Date().getTime();
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.http
      .post(url, params, requestOptions)
      .timeout(600000)
      .map(this.handleSuccess)
      .catch(this.handleError);
  }

  private handleError(error: any): Observable<any> {
    return Observable.throw(error.message || error);
  }

  private handleSuccess(sucess: any) {
    let data = sucess.json() || [];
    // if (null!=data.status && data.status === 401) {
    //     this.router.navigateByUrl('/login');
    //     return;
    // }
    return sucess.json() || [];
  }

  /**
   * 登录
   * @param param
   */
  login(param) {
    return this.post(Config.IP + Config.API.login, param, null);
  }

  /**
   * 测试user
   */
  user() {
    // 添加交验的token
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    const user = JSON.parse(window.localStorage["user"]);
    return this.post(
      Config.IP + Config.API.user + user.id,
      null,
      requestOptions
    );
  }

  /**
   * 获取用户的功能列表
   * @param param
   */
  querySystemAuthorList(param) {
    // 添加交验的token
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.querySystemAuthorList,
      param,
      requestOptions
    );
  }

  /**
   * 新增功能
   * @param param
   */
  addSystemAuthor(param) {
    // 添加交验的token
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addSystemAuthor,
      param,
      requestOptions
    );
  }

  deleteSystemAuthor(param) {
    // 添加交验的token
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deleteSystemAuthor,
      param,
      requestOptions
    );
  }

  deleteSystemAuthorById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deleteSystemAuthorById + param.id,
      param,
      requestOptions
    );
  }

  updateSystemAuthor(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateSystemAuthor,
      param,
      requestOptions
    );
  }

  /**
   * 机构
   */
  queryListParty(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryListParty,
      param,
      requestOptions
    );
  }

  /**
   * 查询公司名称
  * */
  queryCompanyNameList(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryCompanyNameList,
      param,
      requestOptions
    );
  }
  /**
   * 获取角色列表
   * @param param
   */
  querySystemRoleList(param) {
    // 添加交验的token
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.querySystemRoleList,
      param,
      requestOptions
    );
  }
  addParty(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addParty, param, requestOptions);
  }

  partyQueryById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.partyQueryById + param.id,
      null,
      requestOptions
    );
  }

  queryListStrParty(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryListStrParty,
      param,
      requestOptions
    );

  }

  partyUpdate(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.partyUpdate, param, requestOptions);
  }

  partyDeleteListById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.partyDeleteListById,
      param,
      requestOptions
    );
  }

  partyDeleteById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.partyDeleteById + param.id,
      null,
      requestOptions
    );
  }

  getUserList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.getUserList, param, requestOptions);
  }

  queryProgramList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryProgramList, param, requestOptions);
  }

  importElevator(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.importElevator, param, requestOptions);
  }

  upload(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.upload, param, requestOptions);
  }

  deleteUpload(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deleteUpload + param,
      null,
      requestOptions
    );
  }

  addUser(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addUser, param, requestOptions);
  }

  queryUserById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryUserById + param.id,
      null,
      requestOptions
    );
  }

  updateUser(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateUser, param, requestOptions);
  }

  deleteUser(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.deleteUser, param, requestOptions);
  }

  findUserFunction(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findUserFunction + param,
      null,
      requestOptions
    );
  }

  addRole(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addRole, param, requestOptions);
  }

  findUserFunctionByRoleId(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findUserFunctionByRoleId + param,
      null,
      requestOptions
    );
  }

  roleFindById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.roleFindById + param,
      null,
      requestOptions
    );
  }

  updateRole(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateRole, param, requestOptions);
  }

  queryPartyByIdList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryPartyByIdList + param,
      null,
      requestOptions
    );
  }

  deleteRoleByIdList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deleteRoleByIdList,
      param,
      requestOptions
    );
  }

  findByOwnerOrgList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findByOwnerOrgList + param,
      null,
      requestOptions
    );
  }

  findRoleListByUserId(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findRoleListByUserId + param,
      null,
      requestOptions
    );
  }

  /*elevatorGetList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.elevatorGetList,
      param,
      requestOptions
    );
  }*/
  queryElevatorList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryElevatorList,
      param,
      requestOptions
    );
  }
  queryProAndParty(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({headers: header});
    return this.post(
      Config.IP + Config.API.queryProAndParty,
      param,
      requestOptions
    );
  }



  chessboardGetList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.chessboardGetList,
      param,
      requestOptions
    );
  }

  elevatorAdd(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.elevatorAdd, param, requestOptions);
  }
  elevatorUpdate(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.elevatorUpdate,
      param,
      requestOptions
    );
  }

  elevatorSafeUserUpdate(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.elevatorSafeUserUpdate,
      param,
      requestOptions
    );
  }
  chessboardUpdate(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({headers: header});
    return this.post(
      Config.IP + Config.API.chessboardUpdate,
      param,
      requestOptions
    );
  }
    /*修改电梯类型*/
    updateElevatorType(param){
      this.headers.Authorization = "Bearer " + window.localStorage["token"];
      const header = new Headers(this.headers);
      const requestOptions = new RequestOptions({ headers: header });
      return this.post(
        Config.IP + Config.API.updateElevatorType,
        param,
        requestOptions
      );
  }



  queryUserByPartyId(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryUserByPartyId + param,
      null,
      requestOptions
    );
  }
  queryByIdAndTypeList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryByIdAndTypeList,
      param,
      requestOptions
    );
  }
  queryelevatorTypeList() {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryelevatorTypeList,
      null,
      requestOptions
    );
  }

  emergencyRescueList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.emergencyRescueList,
      param,
      requestOptions
    );
  }

  emergencyRescueById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.emergencyRescueById + param,
      null,
      requestOptions
    );
  }

  //删除数组中的某个元素
  removeByValue(arr, val) {
    for (var i = 0; i < arr.length; i++) {
      if (arr[i] == val) {
        arr.splice(i, 1);
        break;
      }
    }
  }

  //获取省province
  getProvince() {
    let provinceList: any = [];
    Config.CITY.forEach(element => {
      if (element.value.substr(2, 4) === "0000") {
        provinceList.push(element);
      }
    });
    return provinceList;
  }
  //获取市
  getCity(val) {
    let cityList: any = [];
    Config.CITY.forEach(element => {
      if (
        element.value.substr(0, 2) == val.value.substr(0, 2) &&
        element.value.substr(2, 4) != "0000" &&
        element.value.substr(4, 2) == "00"
      ) {
        cityList.push(element);
      }
    });
    return cityList;
  }

  //获取区/县
  getRelation(val) {
    let relationList: any = [];
    Config.CITY.forEach(element => {
      if (
        element.value == "110100" ||
        element.value == "120100" ||
        element.value == "310100" ||
        element.value == "500100"
      ) {
        if (
          element.value.substr(0, 3) == val.value.substr(0, 3) &&
          element.value.substr(4, 2) != "00"
        ) {
          element["isLeaf"] = true;
          relationList.push(element);
        }
      } else {
        if (
          element.value.substr(0, 4) == val.value.substr(0, 4) &&
          element.value.substr(4, 2) != "00"
        ) {
          element["isLeaf"] = true;
          relationList.push(element);
        }
      }
    });
    return relationList;
  }

  //获取通知列表
  getNoticeList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getNoticeList,
      params,
      requestOptions
    );
  }
  //获取本人发的通知列表
  getSendNoticeList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getSendNoticeList,
      params,
      requestOptions
    );
  }

  //修改通知为已读
  updateReadState(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateReadState,
      params,
      requestOptions
    );
  }

  //获取资讯列表
  getInformationList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getInformationList,
      params,
      requestOptions
    );
  }

  //根据咨询id获取资讯
  getInformationById(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getInformationById + params.id,
      params,
      requestOptions
    );
  }


  //新增资讯
  addInformation(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addInformation,
      params,
      requestOptions
    );
  }

  //删除资讯
  deleteInformation(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deleteInformation + params.id,
      null,
      requestOptions
    );
  }

  //修改资讯
  updateInformation(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateInformation,
      params,
      requestOptions
    );
  }

  updateMaintanceDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateMaintanceDetail,
      params,
      requestOptions
    );
  }

  addMaintanceDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addMaintanceDetail,
      params,
      requestOptions
    );
  }

  updateUsedDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateUsedDetail,
      params,
      requestOptions
    );
  }

  addUsedDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addUsedDetail,
      params,
      requestOptions
    );
  }

  queryMaintanceDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryMaintanceDetail + params.id,
      null,
      requestOptions
    );
  }

  queryUsedDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryUsedDetail + params.id,
      null,
      requestOptions
    );
  }

  sendNotice(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.sendNotice, params, requestOptions);
  }

  createQrcode() {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.createQrcode, null, requestOptions);
  }

  queryElevatorById(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryElevatorById + params,
      null,
      requestOptions
    );
  }

  getElevatorAppraisal(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getElevatorAppraisal,
      params,
      requestOptions
    );
  }

  getInspectionList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getInspectionList,
      params,
      requestOptions
    );
  }

  getElevatorAppraisByid(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getElevatorAppraisByid + params,
      null,
      requestOptions
    );
  }

  elevatorAppraisAdd(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.elevatorAppraisAdd,
      params,
      requestOptions
    );
  }

  getInspectionById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getInspectionById + param.id,
      null,
      requestOptions
    );
  }

  queryByElevatorList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryByElevatorList,
      params,
      requestOptions
    );
  }

  queryByIdElevator(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryByIdElevator + params,
      null,
      requestOptions
    );
  }

  queryTraction(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryTraction,
      params,
      requestOptions
    );
  }

  queryHydpress(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryHydpress,
      params,
      requestOptions
    );
  }

  queryEscalator(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryEscalator,
      params,
      requestOptions
    );
  }

  queryDebris(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryDebris,
      params,
      requestOptions
    );
  }

  queryTractionDetails(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryTractionDetails + params,
      null,
      requestOptions
    );
  }

  queryHydpressDetails(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryHydpressDetails + params,
      null,
      requestOptions
    );
  }

  queryEscalatorDetails(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryEscalatorDetails + params,
      null,
      requestOptions
    );
  }

  queryDebrisDetails(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryDebrisDetails + params,
      null,
      requestOptions
    );
  }

  getElevatorAppraisalByParty(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getElevatorAppraisalByParty,
      params,
      requestOptions
    );
  }

  updateFeedBack(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateFeedBack,
      params,
      requestOptions
    );
  }

  elevatorAppraisUpdate(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.elevatorAppraisUpdate,
      params,
      requestOptions
    );
  }

  rescueDrillList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.rescueDrillList,
      params,
      requestOptions
    );
  }

  //统计类

  //辖区内电梯的总数量(物业)
  countEleNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countEleNum + params.id,
      null,
      requestOptions
    );
  }

  //辖区内电梯的总数量(维保)
  countEleMaintNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countEleMaintNum + params.id,
      null,
      requestOptions
    );
  }

  //不同类型电梯数量占比
  countEleTypeNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countEleTypeNum + params.id,
      null,
      requestOptions
    );
  }

  //使用年限达10年以上电梯数量
  countLifeOlder(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countLifeOlder + params.id,
      null,
      requestOptions
    );
  }

  //使用年限达10年以下电梯数量
  countLifeYounger(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countLifeYounger + params.id,
      null,
      requestOptions
    );
  }

  //本帐户辖区维保单位数量
  countMaintCompany(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countMaintCompany + params.id,
      null,
      requestOptions
    );
  }

  //本帐户辖区使用单位数量
  countUseCompany(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countUseCompany + params.id,
      null,
      requestOptions
    );
  }
  //各单位 资质 数量 及 占比
  countCompanyQuali(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countCompanyQuali + params.id,
      null,
      requestOptions
    );
  }

  //各星级 维保单位总数及占比
  countStarCompany(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countStarCompany + params.id,
      null,
      requestOptions
    );
  }

  //本帐户辖区安全责任主体单位各类型技术人员持证数量
  countTechmanCompany(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countTechmanCompany + params.id,
      null,
      requestOptions
    );
  }

  //乘客投诉处理的反馈 率
  countFeedbackRio(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countFeedbackRio + params.id,
      null,
      requestOptions
    );
  }

  countMaintNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findMaintCount + params.id,
      null,
      requestOptions
    );
  }

  //本帐户辖区整体维保准时率、各类型周期性维保的平均时长
  countMaint(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countMaint + params.id,
      null,
      requestOptions
    );
  }

  //本帐户辖区周期内整体召修/维修落实率
  countRepair(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countRepair + params.id,
      null,
      requestOptions
    );
  }

  //本帐户辖区周期内现场应急救援累计数
  countRescue(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countRescue + params.id,
      null,
      requestOptions
    );
  }

  //使用单位（物业）应急救援演练总次数
  countRescueDrill(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countRescueDrill + params.id,
      null,
      requestOptions
    );
  }

  //检验机构数量
  countCheckOrgNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countCheckOrgNum + params.id,
      null,
      requestOptions
    );
  }

  //本辖区 人员数量
  countUserNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countUserNum + params.id,
      null,
      requestOptions
    );
  }

  ////年度 乘客投诉次数及比例
  countFeedbackYear(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countFeedbackYear + params.id,
      null,
      requestOptions
    );
  }
  //年度 电梯检验超期 数量 比例
  countOvertimeElevator(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countOvertimeElevator + params.id,
      null,
      requestOptions
    );
  }

  countUsedNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countUsedNum + params.id,
      null,
      requestOptions
    );
  }

  findFuncSID(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findFuncSID + params.userName,
      null,
      requestOptions
    );
  }

  queryMaintElevator(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryMaintElevator,
      params,
      requestOptions
    );
  }

  queryJgElevator(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryJgElevator,
      params,
      requestOptions
    );
  }

  findTodayMaint(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findTodayMaint + params.id,
      null,
      requestOptions
    );
  }

  countUsedZz(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countUsedZz + params.id,
      null,
      requestOptions
    );
  }

  countMaintZz(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countMaintZz + params.id,
      null,
      requestOptions
    );
  }

  countRescueNum(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countRescueNum + params.id,
      null,
      requestOptions
    );
  }

  systemRoleTypeQueryList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.systemRoleTypeQueryList,
      params,
      requestOptions
    );
  }

  systemRoleTypeAdd(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.systemRoleTypeAdd,
      params,
      requestOptions
    );
  }
  systemRoleTypeUpdate(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.systemRoleTypeUpdate,
      params,
      requestOptions
    );
  }

  systemRoleTypeQueryById(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.systemRoleTypeQueryById + params.id,
      null,
      requestOptions
    );
  }

  systemRoleTypeQueryByPartyType(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.systemRoleTypeQueryById + params.id,
      null,
      requestOptions
    );
  }

  roleQueryListAll(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.roleQueryListAll,
      params,
      requestOptions
    );
  }

  // 查询个人用户注册列表
  queryUserCheckList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryUserCheckList,
      params,
      requestOptions
    );
  }

  // 查询企业用户注册列表
  queryPartyCheckList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryPartyCheckList,
      params,
      requestOptions
    );
  }

  //单位注册
  partyRegister(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.partyRegister,
      params,
      requestOptions
    );
  }

  //个人注册
  userRegister(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.userRegister,
      params,
      requestOptions
    );
  }

  //单位审核
  partyCheck(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.partyCheck, params, requestOptions);
  }

  //个人审核
  userCheck(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.userCheck, params, requestOptions);
  }

  /**
   * 查询合同列表
   * @param params
   * @returns {Observable<any>}
   */
  contractQueryByPartyIdList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.contractQueryByPartyIdList,
      params,
      requestOptions
    );
  }
  addContract(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addContract,
      params,
      requestOptions
    );
  }

  /**
   * 添加合同项目
   * @param params
   */
  addContractProject(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addContractProject,
      params,
      requestOptions
    );
  }

  /**
   * 查询合同项目
   * @param params
   */
  queryContractProject(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryContractProject,
      params,
      requestOptions
    );
  }

  /**
   * 删除合同项目
   * @param params
   */
  deleteContractProject(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deleteContractProject,
      params,
      requestOptions
    );
  }

  /**
   * 更新合同项目
   * @param params
   */
  updateContractProject(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateContractProject,
      params,
      requestOptions
    );
  }

  /***
   * 查询机构
   * @param params
   * @returns {Observable<any>}
   */
  queryListRegisterParty(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryListRegisterParty,
      params,
      requestOptions
    );
  }

  /**
   * 根据机构id查询角色类型
   * @param params
   * @returns {Observable<any>}
   */
  registRoleTypeList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.registRoleTypeList + params,
      null,
      requestOptions
    );
  }

  /**
   * 根据角色类型查询角色
   * @param params
   * @returns {Observable<any>}
   */
  registerRoleList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.registerRoleList + params,
      null,
      requestOptions
    );
  }

  //删除合同
  deletePartyContractId(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deletePartyContractId + params,
      null,
      requestOptions
    );
  }

  //查询合同附件
  queryByPartyIdFile(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryByPartyIdFile + params,
      null,
      requestOptions
    );
  }

  //检查机构信息是否已完善
  checkParytIdMessage(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.checkParytIdMessage + params,
      null,
      requestOptions
    );
  }

  /**
   * 根据机构的类型查询角色
   * @param params
   * @returns {Observable<any>}
   */
  queryByPartyTypeList(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryByPartyIdFile + params,
      null,
      requestOptions
    );
  }

  /*
   *电梯文档图片上传
   */

  elevatorUpLoad(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postfile(
      Config.IP + Config.API.elevatorUpLoad,
      params,
      requestOptions
    );
  }

  /*
   *电梯文档图片初始化查询
   */
  elevatorQuery(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.elevatorQuery,
      params,
      requestOptions
    );
  }

  /**
   * 电梯安全管理制度图片上传
   */
  eleSafeManageUpLoad(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postfile(
      Config.IP + Config.API.eleSafeManageUpLoad,
      params,
      requestOptions
    );
  }
  /**
   * 电梯安全管理制度图片初始化查询
   */
  eleSafeManageQuery(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.eleSafeManageQuery,
      params,
      requestOptions
    );
  }

  //识别图片--下次检验日期
  getNextCheckDate(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getNextCheckDate,
      params,
      requestOptions
    );
  }
  //广告查询
  advertiseQuery(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.advertiseQuery,
      param,
      requestOptions
    );
  }

  //广告查询
  advertiseQueryAll() {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.advertiseQueryAll,
      null,
      requestOptions
    );
  }
  //
  advertiseQueryById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.advertiseById,
      param,
      requestOptions
    );
  }
  //广告修改
  advertiseUpdate(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.advertiseUpdate,
      param,
      requestOptions
    );
  }

  //广告添加
  advertiseAdd(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.advertiseAdd,
      params,
      requestOptions
    );
  }

  //广告删除
  advertiseDelete(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.advertiseDelete,
      param,
      requestOptions
    );
  }

  /**
   *
   * @param param 查询安全检查列表
   */
  querySafeControlList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.querySafeControlList,
      param,
      requestOptions
    );
  }

  exportSafeControl(id) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(
      Config.IP + Config.API.exportSafeControl + id,
      null,
      requestOptions
    );
  }

  /**
   * 电梯安全动态管理
   */

  //辖区内电梯各项统计
  countEle(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.countEle, param, requestOptions);
  }
  //辖区内电梯数量分布
  countNumDistrib(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countNumDistrib,
      param,
      requestOptions
    );
  }
  //辖区内电梯类型分布
  countTypeDistrib(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countTypeDistrib,
      param,
      requestOptions
    );
  }
  //辖区内电梯年限分布
  countYearDistrib(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countYearDistrib,
      param,
      requestOptions
    );
  }
  //辖区内保障力量分布
  countOperDistrib(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countOperDistrib,
      param,
      requestOptions
    );
  }
  //辖区内各项安全状况统计
  countSafeNum(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countSafeNum,
      param,
      requestOptions
    );
  }
  //电梯安全保障工作落实情况
  countMaintRepairNum(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countMaintRepairNum,
      param,
      requestOptions
    );
  }
  //电梯事故隐患排除情况
  countRepairNum(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countRepairNum + param,
      null,
      requestOptions
    );
  }
  //电梯安全保障工作超期情况
  statCountMaintNum(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.countMaintNum ,
      param,
      requestOptions
    );
  }
  //各类前十名排行榜
  ranks(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.ranks, param, requestOptions);
  }

  findRanks(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.findRanks, param, requestOptions);
  }



  //年度统计数据汇总
  countQuartz(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.countQuartz, param, requestOptions);
  }

  exportMaint(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.exportMaint, param, requestOptions);
  }

  batchExportWorkRecords(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.batchExportWorkRecords, param, requestOptions);
  }

  exportRandomList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.exportRandomList, param, requestOptions);
  }

  exportDaily(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.exportDaily, param, requestOptions);
  }

  updateUserState(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateUserState,
      param,
      requestOptions
    );
  }

  updateUserParty(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateUserParty,
      param,
      requestOptions
    );
  }

  addMeatasis(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addMeatasis,
      param,
      requestOptions
    );
  }

  updateMeatasis(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updateMeatasis,
      param,
      requestOptions
    );
  }

  findTomy(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.findTomy,
      param,
      requestOptions
    );
  }

  recordOvertimeEle(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.recordOvertimeEle,
      param,
      requestOptions
    );
  }
  //监管批量发消息
  batchMsg(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.batchMsg, param, requestOptions);
  }

  maintenanceList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.maintenanceList,
      param,
      requestOptions
    );
  }

  maintenanceDeleteById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.maintenanceDeleteById + "/" + param,
      null,
      requestOptions
    );
  }

  maintenanceFindById(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.maintenanceFindById + "/" + param,
      null,
      requestOptions
    );
  }

  maintenanceAdd(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.maintenanceAdd,
      param,
      requestOptions
    );
  }

  forgetPwd(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.forgetPwd, param, requestOptions);
  }

  deleteElevator(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deleteElevator,
      param,
      requestOptions
    );
  }
  batchDeleteElevator(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.batchDeleteElevator,
      param,
      requestOptions
    );
  }

  exportEmRsc(id) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.epEmRsc + id, null, requestOptions);
  }

  exportEmRscDrill(id) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.epEmRscDrill + id,
      null,
      requestOptions
    );
  }

  querySelfCheckList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.querySelfCheckList,
      param,
      requestOptions
    );
  }

  querySelfCheckDetail(id) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.querySelfCheckDetail + id,
      null,
      requestOptions
    );
  }

  getLatLng(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.getLatLng, param, requestOptions);
  }

  queryPlanDict(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryPlanDict,
      params,
      requestOptions
    );
  }

  addPlanDict(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.addPlanDict,
      params,
      requestOptions
    );
  }

  updatePlanDict(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updatePlanDict,
      params,
      requestOptions
    );
  }

  deletePlanDict(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deletePlanDict,
      params,
      requestOptions
    );
  }

  updatePlanDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.updatePlanDetail,
      params,
      requestOptions
    );
  }

  deletePlanDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.deletePlanDetail,
      params,
      requestOptions
    );
  }

  queryPlanDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryPlanDetail,
      params,
      requestOptions
    );
  }

  queryCheckItem(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryCheckItem, params, requestOptions);
  }

  addPlanDictItem(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addPlanDictItem, params, requestOptions);
  }

  queryPlanDictItem(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryPlanDictItem, params, requestOptions);
  }

  deleteCheckItem(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.deleteCheckItem, params, requestOptions);
  }

  publishPlanDetail(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.publishPlanDetail, params, requestOptions);
  }

  updateSafeLawDoc(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateSafeLawDoc, param, requestOptions);
  }

  updateSafePunDoc(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateSafePunDoc, param, requestOptions);
  }

  updateSafeEvidences(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateSafeEvidences, param, requestOptions);
  }

  addPublicRandom(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addPublicRandom, param, requestOptions);
  }

  updatePublicRandom(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updatePublicRandom, param, requestOptions);
  }

  deletePublicRandom(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.deletePublicRandom, param, requestOptions);
  }

  queryPublicRandom(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryPublicRandom, param, requestOptions);
  }

  addPublicRandomResult(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addPublicRandomResult, param, requestOptions);
  }

  exportPublicRandomResult(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.exportPublicRandomResult, param, requestOptions);
  }

  exportPublicRandomResAft(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.exportPublicRandomResAft, param, requestOptions);
  }

  queryRandomList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryRandomList, param, requestOptions);
  }

  queryEmpiric(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryEmpiric, param, requestOptions);
  }

  updateUserPwd(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateUserPwd, param, requestOptions);
  }

  updateUserPhone(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateUserPhone, param, requestOptions);
  }

  addByUpload(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addByUpload, param, requestOptions);
  }

  selfCount(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.selfCount, param, requestOptions);
  }

  // 报表查询
  findListReport(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.findListReport, param, requestOptions);
  }
  // 报表修改
  updateReports(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateReport, param, requestOptions);
  }
  // 报表删除
  deleteReports(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.deleteReport, param, requestOptions);
  }
  // 报表新增
  insertReports(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.insertReport, param, requestOptions);
  }
  // 通过SQL查询数据
  findPortInfo(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.findPortInfo, param, requestOptions);
  }
  // 通过SQL导出数据
  export(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.export, param, requestOptions);
  }
  // 维保抽查计划查询
  querySpotPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.querySpotPlan, param, requestOptions);
  }
  // 维保抽查计划查询
  queryPlanDetails(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryPlanDetails, param, requestOptions);
  }
  // 维保抽查计划删除
  deleteSpotPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.deleteSpotPlan, param, requestOptions);
  }
  // 维保抽查计划新增
  insertSpotPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.insertSpotPlan, param, requestOptions);
  }
  // 动态查询检查项目
  querySpotCheckItem(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.querySpotCheckItem, params, requestOptions);
  }
  // 新增实施对象
  insertSpotObjectPlans(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.insertSpotObjectPlans, params, requestOptions);
  }
  // 新增检查人员
  insertCheckMan(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.insertCheckMan, params, requestOptions);
  }
  // 实施对象查询
  findSpotObjectPlans(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.findSpotObjectPlans, params, requestOptions);
  }
  // 实施维保检查项
  addSpotCheckItem(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addSpotCheckItem, params, requestOptions);
  }
  // 查询维保检查项
  findSpotCheckItem(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.findSpotCheckItem, params, requestOptions);
  }



  //电梯培训模块
  addTrainingPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.addTrainingPlan, param, requestOptions);
  }

  updateTrainingPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateTrainingPlan, param, requestOptions);
  }

  deleteTrainingPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.deleteTrainingPlan, param, requestOptions);
  }

  queryTrainingPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryTrainingPlan, param, requestOptions);
  }
  uploadMaterials(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.uploadMaterials, param, requestOptions);
  }

  uploadCheckInTable(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.uploadCheckInTable, param, requestOptions);
  }

  uploadTestPaper(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.uploadTestPaper, param, requestOptions);
  }
  uploadSummaryStatement(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.uploadSummaryStatement, param, requestOptions);
  }
  queryTrainingPlanDetail(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.queryTrainingPlanDetail, param, requestOptions);
  }

  deleteTrainingPlanDetail(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.deleteTrainingPlanDetail, param, requestOptions);
  }

  updateTrainingPlanDetail(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateTrainingPlanDetail, param, requestOptions);
  }

  updateTrainingPlanStatus(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(Config.IP + Config.API.updateTrainingPlanStatus, param, requestOptions);
  }

  updateTrainingPhoto(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updateTrainingPhoto, param, requestOptions);
  }
  updateCheckInTable(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updateCheckInTable, param, requestOptions);
  }
  updateSummaryStatement(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updateSummaryStatement, param, requestOptions);
  }
  // 删除维保自定义项
  deleteCustomCheckItem(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.deleteCustomCheckItem, param, requestOptions);
  }

  // 删除实施对象计划
  deleteObjectPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.deleteObjectPlan, param, requestOptions);
  }
  // 发送通知
  sendMessageObjectPlan(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.sendMessageObjectPlan, param, requestOptions);
  }
  // 实施对象导出
  exportExcelObj(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.exportExcelObj, param, requestOptions);
  }

  // 实施对象一行导出记录表
  exportExcelClown(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.exportExcelClown, param, requestOptions);
  }

  // 维保质量统计
  spotObjectCensus(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.spotObjectCensus, param, requestOptions);
  }

  // 首页辖区内电梯类型分布
  countTypeDistribType(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.countTypeDistribType, param, requestOptions);
  }

  // 获取积分维护列表
  pointDefendList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.pointDefendList, param, requestOptions);
  }

  // 获取积分维护列表
  insertPointDefend(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.insertPointDefend, param, requestOptions);
  }
  // 批量删除
  deletePointDefend(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.deletePointDefend, param, requestOptions);
  }
  // 修改
  updatePointDefend(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updatePointDefend, param, requestOptions);
  }
  // 获取积分流水
  pointflowList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.pointflowList, param, requestOptions);
  }
  // 修改合同
  updateContract(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updateContract, param, requestOptions);
  }

  // 双随机查询数据
  getElevatorList(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.getElevatorList, param, requestOptions);
  }

  // 双随机主体单位数据导出
  exportRandomPort(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.exportRandomPort, param, requestOptions);
  }

  // 双随机主体初始化单位
  findUnit(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.findUnit, param, requestOptions);
  }
  // 双随机查询监管单位下的用户信息
  queryUnit(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.queryUnit, param, requestOptions);
  }

  // 双随机开始随机进行匹配
  startDistribution(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.startDistribution, param, requestOptions);
  }

  // 双随机导出分配后的结果
  exportDistribution(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.exportDistribution, param, requestOptions);
  }

  /**
   * 按需维保——start
   */
  queryDemandMaintence(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.queryDemandMaintence, param, requestOptions);
  }

  addDemandMaintence(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.addDemandMaintence, param, requestOptions);
  }

  deleteDemandMaintence(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.deleteDemandMaintence, param, requestOptions);
  }

  updateDemandMaintence(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updateDemandMaintence, param, requestOptions);
  }

  demandMaintGetElevators(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.demandMaintGetElevators, param, requestOptions);
  }

  demandExportFile(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.demandExportFile, param, requestOptions);
  }

  elevatorCreateCompany(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.elevatorCreateCompany, param, requestOptions);
  }
  /**
   * 按需维保——end
   */

  /**
   * 无纸化维保
   */
  queryPaperlessMaintance(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.queryPaperlessMaintance, param, requestOptions);
  }

  addPaperlessMaintance(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.addPaperlessMaintance, param, requestOptions);
  }

  updatePaperlessMaintance(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updatePaperlessMaintance, param, requestOptions);
  }

  deletePaperlessMaintance(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.deletePaperlessMaintance, param, requestOptions);
  }

  exportLetterOfCommitmentDoc(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.exportLetterOfCommitmentDoc, param, requestOptions);
  }

  queryPartyByPartyLevel(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.queryPartyByPartyLevel, param, requestOptions);
  }

  paperlessMaintGetElevators(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.paperlessMaintGetElevators, param, requestOptions);
  }

  getOptionalJgParty(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.getOptionalJgParty, param, requestOptions);
  }

  /**
   * 初始化工单
   */
  initWorkOrder(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.initWorkOrder, param, requestOptions);
  }

  /**
   * 消息代码
   */
  informationAgent(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.informationAgent, param, requestOptions);
  }

  /**
   * 委托检测
   */
  detectionGetElevator(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.detectionGetElevator, param, requestOptions);
  }

  addDetectionElevator(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.addDetectionElevator, param, requestOptions);
  }

  updateDetectionElevator(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.updateDetectionElevator, param, requestOptions);
  }

  queryDetectionElevator(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.postNoBase(Config.IP + Config.API.queryDetectionElevator, param, requestOptions);
  }

  /**
   * @Description:查询无主电梯信息
   * @Author:lile
   * @Date:2019/09/29
   * @param params
   */
  queryNoownerElevator(params) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryNoownerElevator,
      params,
      requestOptions
    );
  }

  /**
   * @Description:修改無主電梯信息
   * @param param
   * @returns {Observable<any>}
   */
  noownerElevatorUpdate(param) {
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.noownerElevatorUpdate,
      param,
      requestOptions
    );
  }

  /**
   * 查询维保公司名称
   * */
  queryMaintenanceCompanyNameList(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryMaintenanceCompanyNameList,
      param,
      requestOptions
    );
  }

  /**
   * @Description:查询使用单位名称
   * @param param
   * @returns {Observable<any>}
   */
  queryUseCompanyNameList(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryUseCompanyNameList,
      param,
      requestOptions
    );
  }

  /**
   * 查询未确认维保单
   * */
  queryUnconfirmedMaintenance(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryUnconfirmedMaintenance,
      param,
      requestOptions
    );
  }

  /**
   * 发送未确认维保单
   * */
  sendNoticeUnconfirmed(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.sendNoticeUnconfirmed,
      param,
      requestOptions
    );
  }

  /**
   * 查询待确认维保单
   * */
  queryNeedconfirmedMaintenance(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryNeedconfirmedMaintenance,
      param,
      requestOptions
    );
  }

  /**
   * 通过等级查询分局信息
   * @param param
   */
  queryListByLevel(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.queryListByLevel,
      param,
      requestOptions
    );
  }

  /**
   * 通过等级查询电梯信息
   * @param param
   */
  getLatLngByLevel(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.getLatLngByLevel,
      param,
      requestOptions
    );
  }



  sureUnconfirmed(param){
    this.headers.Authorization = "Bearer " + window.localStorage["token"];
    const header = new Headers(this.headers);
    const requestOptions = new RequestOptions({ headers: header });
    return this.post(
      Config.IP + Config.API.sureUnconfirmed,
      param,
      requestOptions
    );
  }






}
